package model

import (
	"database/sql"
	"time"
)

type CmsNews struct {
	ResCommon
	Name                  string
	Content               sql.NullString
	CategId               sql.NullInt64
	CategCode             sql.NullString
	ParentId              sql.NullInt64
	NaviContentTf         sql.NullString `gorm:"column:navicontenttf"`
	SNewsTitle            sql.NullString `gorm:"column:snewstitle"`
	Sequence              int            `gorm:"default:0"`
	Newtype               string         `gorm:"default:普通"`
	Date                  string
	AccessToken           string
	State                 string `gorm:"default:新建"`
	Click                 string `gorm:"default:0"`
	PriceUnit             string `gorm:"default:1"`
	UserId                sql.NullInt64
	CompanyId             sql.NullInt64
	User                  ResUsers
	Lang                  sql.NullString `gorm:"default:zh-CN"`
	IsVip                 bool           `gorm:"default:false"`
	Categ                 CmsCategory
	AppStyle              sql.NullString
	NewspropertyCommtf    sql.NullBool   //允许评论
	NewspropertyRectf1    sql.NullBool   //推荐
	NewspropertyMartf1    sql.NullBool   //滚动
	NewspropertyHottf1    sql.NullBool   //热点
	NewspropertyFiltf1    sql.NullBool   //幻灯
	NewspropertyTttf1     sql.NullBool   //头条
	NewspropertyCarefully sql.NullBool   //精选
	IsPlacement           sql.NullBool   //置顶
	NewspropertyAnntf1    sql.NullBool   //公告
	NewspropertyJctf1     sql.NullBool   //精彩
	NewspropertyWapf1     sql.NullBool   //WAP
	Vurl                  sql.NullString //视频地址
	SouceId               sql.NullInt64
	Souce                 CmsSouce
}

type CmsCategory struct {
	ResCommon
	Name         string
	CompleteName string
	Note         string
	Code         string
	ParentId     sql.NullInt64
	ParentPath   string
	Active       bool `gorm:"default:true"`
	Public       bool `gorm:"default:true"`
}

type CmsNewsComment struct {
	ResCommon
	CommentId int64
	Name      sql.NullString
	UserId    int64
	User      ResUsers
	ParentId  sql.NullInt64
	Parent    *CmsNewsComment
	Score     int
	Comment   string
}

// CmsNewsFollowsRel 收藏
type CmsNewsFollowsRel struct {
	CmsId  int64
	UserId int64
}

// CmsPraise 点赞
type CmsPraise struct {
	Name       string
	UserId     int64
	OrderId    int64
	CreateDate time.Time
}

// CmsSouce 来源
type CmsSouce struct {
	ResCommon
	Name string
}
